{template 'tpl_header'}

<div class="weui-search-bar" id="searchBar">
    <form class="weui-search-bar__form">
        <div class="weui-search-bar__box">
            <i class="weui-icon-search"></i>
            <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" value="{$search}"
                   required="">
            <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
        </div>
        <label class="weui-search-bar__label" id="searchText"
               style="transform-origin: 0px 0px 0px; opacity: 1; transform: scale(1, 1);">
            <i class="weui-icon-search"></i>
            <span>{$search}</span>
        </label>
    </form>
    <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
</div>
<div class="swiper-container">
    <div class="swiper-wrapper">
        {loop $dest['thumbs'] $thumbs}
        <div class="swiper-slide">
            <img src="{php echo tomedia($thumbs)}"/>
        </div>
        {/loop}
    </div>
    <div class="swiper-pagination"></div>
</div>

<div class="btn_space_area">
    <a href="{php echo url('entry', array('m' => 'vj_bontrip','do' => 'single','id' => $id),true); }"
       class="weui-btn weui-btn_mini weui-btn_default">单品 ( {$dest['single_number']} )</a>
    <a href="javascript:;" class="weui-btn weui-btn_mini weui-btn_primary">一日游 ( {$dest['oneday_number']} )</a>
    <a href="{php echo url('entry', array('m' => 'vj_bontrip','do' => 'quality','id' => $id),true); }"
       class="weui-btn weui-btn_mini weui-btn_default">精品游 ( {$dest['quality_number']} )</a>
</div>

<div class="weui-body__bg_color">
    {if !empty($onedays) }
    {loop $onedays $oneday}
    <div class="weui-flex weui-flex__col2" style="position: relative">
        <div class="weui-flex weui-flex__col2">
            <a href="{php echo url('entry', array('m' => 'vj_bontrip','do' => 'goods','id' => $oneday['id'],'type' => 'oneday'),true);}"
               class="weui-flex__item weui-flex__col2__style2">
                <img src="{php echo tomedia($oneday['thumb'])}">
                <div class="weui-flex__col2__style2__title">
                    <span>{$oneday['name']}</span>
                </div>
                <div class="weui-flex__col2__style2__desc">
                    <span>{$oneday['introduction']}</span>
                </div>
                {if !empty($oneday['tag']) }
                <div class="weui-flex__col2__style2__place" style="display: inherit;">
                    {php $tags = explode(',',$oneday['tag']) }
                    {loop $tags $tag}
                    <span class="weui-flex__col2__style2__label">{$tag}</span>
                    {/loop}
                    <div style="clear: both;"></div>
                </div>
                {/if}
                <div class="weui-flex__col2__style2__price">
                    <span>¥{php echo round($oneday['adult_price']*$oneday['exchange_rate'])}／人起</span>
                </div>
            </a>
            {if !empty($oneday['label']) }
            <div class="weui-flex__col2__top_tag">
                <div class="weui-flex__col2__top_tag_content">
                    <span>&bull;</span><br>
                    <span>{$oneday['label']}</span>
                </div>
                <div class="weui-flex__col2__top_tag_border"></div>
            </div>
            {/if}
        </div>
    </div>
    {/loop}
    {else}
    <div id="list_null" class="weui-loadmore weui-loadmore_line">
        <span class="weui-loadmore__tips">暂无数据</span>
    </div>
    {/if}
</div>
<div id="loading" class="weui-loadmore">
    <i class="weui-loading"></i>
    <span class="weui-loadmore__tips">正在加载</span>
</div>

<div class="weui-whitespace weui-whitespace__xl"></div>


{template 'tpl_footer'}

<script src="{MOBILE_RES}js/swiper.min.js"></script>
<script>
    $('#loading').hide();
    $(function () {
        $(".swiper-container").swiper({
            loop: true,
            autoplay: 3000
        });
        $('.weui-search-bar__form').submit(function (event) {
            event.preventDefault();
            var url = "{php echo url('entry', array('m' => 'vj_bontrip','do' => 'oneday','id' => $id),true); }";
            window.location.href = url + "&search=" + $('#searchInput').val();
        });
    });
</script>